package com.ontheroad.leanCloud.event;

import com.ontheroad.leanCloud.model.DeviceType;
import com.ontheroad.leanCloud.model.SessionType;
import org.springframework.context.ApplicationEvent;

/**
 * Created by kedong on 2017/11/15 0015.
 */
public class PushEvent extends ApplicationEvent {

    private static final long serialVersionUID = -7241152192145100492L;

    /**
     * Create a new ApplicationEvent.
     *
     * @param source         the component that published the event (never {@code null})
     * @param type
     * @param content
     * @param deviceType
     * @param installationId
     */
    public PushEvent(Object source, SessionType type, String content, DeviceType deviceType, String installationId) {
        super(source);
        this.type = type;
        this.content = content;
        this.deviceType = deviceType;
        this.installationId = installationId;
    }


    private final SessionType type;
    /**
     * 消息内容
     */
    private final String content;

    /**
     * 设备类型
     */
    private final DeviceType deviceType;

    /**
     * 用户的推送ID
     */
    private final String installationId;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public SessionType getType() {
        return type;
    }

    public String getContent() {
        return content;
    }

    public DeviceType getDeviceType() {
        return deviceType;
    }

    public String getInstallationId() {
        return installationId;
    }
}
